/**
 * $Revision: 1.0 $
 * $Author: Eric Yang $
 * $Date: Aug 9, 2009 10:55:22 PM $
 *
 * Author: Eric Yang
 * Date  : Aug 9, 2009 10:55:22 PM
 *
 */
package com.gooex.web.action;

import java.util.List;
import org.apache.commons.lang.math.RandomUtils;

import com.gooex.domain.base.Order;
import com.gooex.service.base.IOrderManager;


/**
 * @author Eric Yang
 * @version 1.0
 */
public class IndexAction extends BaseAnonymousAction {

	protected IOrderManager orderManager;

	private List<Order> orders;

	private int sloganSize;

	public String execute() throws Exception {
		orders = orderManager.getTopNewOrders(getCurrentRegion().getId(), page);
		return SUCCESS;
	}

	public List<Order> getOrders() {
		return orders;
	}

	public void setOrderManager(IOrderManager orderManager) {
		this.orderManager = orderManager;
	}

	public int getSloganSize() {
		return sloganSize;
	}

	public int getSloganIndex() {
		return RandomUtils.nextInt(sloganSize);
	}

	public void setSloganSize(int sloganSize) {
		this.sloganSize = sloganSize;
	}

}
